{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 一、导入数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 195,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>season</th>\n",
       "      <th>month</th>\n",
       "      <th>holiday</th>\n",
       "      <th>day_of_week</th>\n",
       "      <th>workingday</th>\n",
       "      <th>weather</th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>humidity</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>56.2083</td>\n",
       "      <td>0.194037</td>\n",
       "      <td>3830.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>65.2917</td>\n",
       "      <td>0.350133</td>\n",
       "      <td>2114.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>36.0</td>\n",
       "      <td>37.0</td>\n",
       "      <td>56.8333</td>\n",
       "      <td>0.149883</td>\n",
       "      <td>915.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>49.0833</td>\n",
       "      <td>0.268033</td>\n",
       "      <td>4322.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>2.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>28.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>69.7083</td>\n",
       "      <td>0.215171</td>\n",
       "      <td>6591.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Unnamed: 0  season  month  holiday  day_of_week  workingday  weather  temp  \\\n",
       "0           0     1.0    2.0      0.0          4.0         1.0      1.0   2.0   \n",
       "1           1     1.0   12.0      0.0          4.0         1.0      2.0   1.0   \n",
       "2           2     2.0    6.0      0.0          4.0         1.0      2.0  36.0   \n",
       "3           3     1.0    2.0      0.0          1.0         1.0      1.0   8.0   \n",
       "4           4     2.0    5.0      0.0          0.0         0.0      1.0  28.0   \n",
       "\n",
       "   atemp  humidity  windspeed   count  \n",
       "0    6.0   56.2083   0.194037  3830.0  \n",
       "1    3.0   65.2917   0.350133  2114.0  \n",
       "2   37.0   56.8333   0.149883   915.0  \n",
       "3   12.0   49.0833   0.268033  4322.0  \n",
       "4   29.0   69.7083   0.215171  6591.0  "
      ]
     },
     "execution_count": 195,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "data=pd.read_csv(\"Bikeshare_test.csv\")\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**data.columns** #查看DataFrame的列名，可以使用.tolist()将其转换为列表    \n",
    "**data.index** #查看DataFrame的列名，可以使用.tolist()将其转换为列表  \n",
    "\n",
    "---\n",
    "上述取索引、取列名的方法可以在对DataFrame的增删改查中灵活运用\n",
    "\n",
    "---"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 196,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "查看列名称columns： ['Unnamed: 0', 'season', 'month', 'holiday', 'day_of_week', 'workingday', 'weather', 'temp', 'atemp', 'humidity', 'windspeed', 'count']\n",
      "获取指定(eg:month)列的索引: 2\n"
     ]
    }
   ],
   "source": [
    "columns=data.columns.tolist()\n",
    "print(\"查看列名称columns：\",columns)\n",
    "print(\"获取指定(eg:month)列的索引:\",columns.index(\"month\"))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 二、增删操作"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 197,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>season</th>\n",
       "      <th>My Insert</th>\n",
       "      <th>month</th>\n",
       "      <th>My Insert2</th>\n",
       "      <th>holiday</th>\n",
       "      <th>day_of_week</th>\n",
       "      <th>workingday</th>\n",
       "      <th>weather</th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>humidity</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>count</th>\n",
       "      <th>My Add</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>Test2</td>\n",
       "      <td>2.0</td>\n",
       "      <td>Test3</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>49.0833</td>\n",
       "      <td>0.268033</td>\n",
       "      <td>4322.0</td>\n",
       "      <td>Test1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>2.0</td>\n",
       "      <td>Test2</td>\n",
       "      <td>5.0</td>\n",
       "      <td>Test3</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>28.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>69.7083</td>\n",
       "      <td>0.215171</td>\n",
       "      <td>6591.0</td>\n",
       "      <td>Test1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>Test2</td>\n",
       "      <td>8.0</td>\n",
       "      <td>Test3</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>25.0</td>\n",
       "      <td>26.0</td>\n",
       "      <td>54.8333</td>\n",
       "      <td>0.125008</td>\n",
       "      <td>5204.0</td>\n",
       "      <td>Test1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>6</td>\n",
       "      <td>4.0</td>\n",
       "      <td>Test2</td>\n",
       "      <td>11.0</td>\n",
       "      <td>Test3</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>55.5652</td>\n",
       "      <td>0.115522</td>\n",
       "      <td>5323.0</td>\n",
       "      <td>Test1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>7</td>\n",
       "      <td>3.0</td>\n",
       "      <td>Test2</td>\n",
       "      <td>9.0</td>\n",
       "      <td>Test3</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>27.0</td>\n",
       "      <td>28.0</td>\n",
       "      <td>79.0417</td>\n",
       "      <td>0.212696</td>\n",
       "      <td>3351.0</td>\n",
       "      <td>Test1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   season My Insert  month My Insert2  holiday  day_of_week  workingday  \\\n",
       "3     1.0     Test2    2.0      Test3      0.0          1.0         1.0   \n",
       "4     2.0     Test2    5.0      Test3      0.0          0.0         0.0   \n",
       "5     3.0     Test2    8.0      Test3      0.0          2.0         1.0   \n",
       "6     4.0     Test2   11.0      Test3      0.0          4.0         1.0   \n",
       "7     3.0     Test2    9.0      Test3      1.0          1.0         0.0   \n",
       "\n",
       "   weather  temp  atemp  humidity  windspeed   count My Add  \n",
       "3      1.0   8.0   12.0   49.0833   0.268033  4322.0  Test1  \n",
       "4      1.0  28.0   29.0   69.7083   0.215171  6591.0  Test1  \n",
       "5      1.0  25.0   26.0   54.8333   0.125008  5204.0  Test1  \n",
       "6      1.0   3.0    8.0   55.5652   0.115522  5323.0  Test1  \n",
       "7      2.0  27.0   28.0   79.0417   0.212696  3351.0  Test1  "
      ]
     },
     "execution_count": 197,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#在DataFrame最后增加一列\n",
    "data['My Add']=\"Test1\"#在DataFrame最后添加一列，所有的值都为1。（也可传入列表，但必须保政长度一致）\n",
    "\n",
    "#在DataFrame中指定位置插入一列\n",
    "data.insert(2,'My Insert',\"Test2\") #在第2列，加上column名称为\"My Insert\"，所有值均为（My Insert）\n",
    "data.insert(columns.index('holiday')+1,'My Insert2',\"Test3\") #参数同上，在第holiday列前添加一列（注意holiday的索引+1为其前一列的位置，+2为后一列的位置）\n",
    "\n",
    "#删除三个参数:索引名称;索引维度axis,1表示列,0表示行;inplace是否对原数据生效）\n",
    "data.drop([columns[0]],axis=1,inplace=True)#第一个列表参数中传入多个值则表示删除多列\n",
    "#删除行\n",
    "data.drop([0,1,2],axis=0,inplace=True)#删除行，列表参数中的元素则应传入索引值。\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 三、查询操作"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 首先来看最简单的查询"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 198,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "data['season']#确season列\n",
    "data[['season','month','holiday']]#取多列\n",
    "\n",
    "#单一条件查找\n",
    "data[data['month']==2]#取DataFrame中month为2的所有数据\n",
    "data[data['month']==2]['count']#取DataFrame中month为2的count列的值\n",
    "data[data['month']==2][['count','holiday']]#取DataFrame中month为2的count、holiday列的值\n",
    "\n",
    "#多条件查找\n",
    "data[(data['month']==1) | (data['holiday']==1)]#取DataFrame中month为1, 或者  holiday为1的所有数据\n",
    "data[(data['month']==1) & (data['holiday']==1)]#取DataFrame中month为1, 并且  holiday为1的所有数据\n",
    "data[(data['month']==1) & (data['holiday']==1)]['count']#取DataFrame中month为1, 并且  holiday为1的所有数据中的count列\n",
    "data[(data['month']==1) & (data['holiday']==1)][['count','temp']]#取DataFrame中month为1, 并且  holiday为1的所有数据中的count、temp列\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 再来看看使用pandas的.loc与.iloc进行的查询\n",
    "典型用法如下    \n",
    "**data.loc[行索引或名称,列索引或名称]     \n",
    "data.iloc[行索引,列索引]** \n",
    "\n",
    "两种切片方法其实只要熟悉掌握了其中一种就可了    \n",
    "个人更倾向于使用.loc对于多条件筛选可以很直观地写出代码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 199,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "data.loc[5,'season']#取season列的第五行的值\n",
    "data.loc[10:15, ['season','holiday']]  #选取第10行到第15行，season列和holiday列的数据, 注意这里的行选取是包含下标的。\n",
    "data.loc[[10,11],['season','holiday']] \t\t #选取指定的第10行和第11行，season和holiday列的数据\n",
    "data.loc[data['season']==1,'count'] \t #选取season列是1，count列的数据\n",
    "data.loc[data['season']==2,['count','holiday']] #选取season列是2，count和holiday列的数据\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 200,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "data.iloc[0,0]   #第0行第0列的数据\n",
    "data.iloc[1,2]     #第1行第2列的数据\n",
    "data.iloc[[1,3],0:2] #第1行和第3行，从第0列到第2列（不包含第2列）的数据\n",
    "data.iloc[1:3,[1,2]]  #第1行到第3行（不包含第3行），第1列和第2列的数据\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 四、修改操作\n",
    "同样的，在修改操作中我们需要使用的依然是 **.loc或者.iloc**，这样才能方便地定位到特定元素进行修改"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 201,
   "metadata": {},
   "outputs": [],
   "source": [
    "#修改列名(修改列名的参数是columns，传入的参数是字典key为原列名,value为新列名)\n",
    "data.rename(columns={\"holiday\":\"h\"},inplace=True)#将holiday名称修改为h\n",
    "data.rename(columns={\"h\":\"holiday\",'season':\"SEASON\"},inplace=True)#修改多列的列名\n",
    "#data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 202,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "查看一下修改后的第5列的值：\n",
      " ['哈哈哈哈哈', '哈哈哈哈哈', '哈哈哈哈哈', '哈哈哈哈哈', 1, '哈哈哈哈哈', '哈哈哈哈哈', '哈哈哈哈哈', '哈哈哈哈哈', '哈哈哈哈哈', '哈哈哈哈哈', '哈哈哈哈哈', '哈哈哈哈哈', '哈哈哈哈哈', 1]\n"
     ]
    }
   ],
   "source": [
    "data.loc[10,'season'] = 2 #修改index为10，column为season的那一个值为aa。\n",
    "data.loc[5] = \"哈哈哈哈哈\" #修改index为‘5’的那一行的所有值。\n",
    "data.loc[5,['season','holiday']] = [1,1]    #修改index为5，column为season的那一个值为1，holiday列的值为1。\n",
    "print(\"查看一下修改后的第5列的值：\\n\",data.loc[5].tolist())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 203,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>SEASON</th>\n",
       "      <th>My Insert</th>\n",
       "      <th>month</th>\n",
       "      <th>My Insert2</th>\n",
       "      <th>holiday</th>\n",
       "      <th>day_of_week</th>\n",
       "      <th>workingday</th>\n",
       "      <th>weather</th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>humidity</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>count</th>\n",
       "      <th>My Add</th>\n",
       "      <th>season</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>Test2</td>\n",
       "      <td>一整列被修改了</td>\n",
       "      <td>Test3</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>8</td>\n",
       "      <td>12</td>\n",
       "      <td>49.0833</td>\n",
       "      <td>0.268033</td>\n",
       "      <td>4322</td>\n",
       "      <td>Test1</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>一整行被修改了</td>\n",
       "      <td>一整行被修改了</td>\n",
       "      <td>一整行被修改了</td>\n",
       "      <td>一整行被修改了</td>\n",
       "      <td>一整行被修改了</td>\n",
       "      <td>一整行被修改了</td>\n",
       "      <td>一整行被修改了</td>\n",
       "      <td>一整行被修改了</td>\n",
       "      <td>一整行被修改了</td>\n",
       "      <td>一整行被修改了</td>\n",
       "      <td>一整行被修改了</td>\n",
       "      <td>一整行被修改了</td>\n",
       "      <td>一整行被修改了</td>\n",
       "      <td>一整行被修改了</td>\n",
       "      <td>一整行被修改了</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td>哈哈哈哈哈</td>\n",
       "      <td>哈哈哈哈哈</td>\n",
       "      <td>一整列被修改了</td>\n",
       "      <td>哈哈哈哈哈</td>\n",
       "      <td>1</td>\n",
       "      <td>哈哈哈哈哈</td>\n",
       "      <td>哈哈哈哈哈</td>\n",
       "      <td>哈哈哈哈哈</td>\n",
       "      <td>哈哈哈哈哈</td>\n",
       "      <td>哈哈哈哈哈</td>\n",
       "      <td>哈哈哈哈哈</td>\n",
       "      <td>哈哈哈哈哈</td>\n",
       "      <td>哈哈哈哈哈</td>\n",
       "      <td>哈哈哈哈哈</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>Test2</td>\n",
       "      <td>一整列被修改了</td>\n",
       "      <td>Test3</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>8</td>\n",
       "      <td>55.5652</td>\n",
       "      <td>0.115522</td>\n",
       "      <td>5323</td>\n",
       "      <td>Test1</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>7</td>\n",
       "      <td>3</td>\n",
       "      <td>Test2</td>\n",
       "      <td>一整列被修改了</td>\n",
       "      <td>Test3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>27</td>\n",
       "      <td>28</td>\n",
       "      <td>79.0417</td>\n",
       "      <td>0.212696</td>\n",
       "      <td>3351</td>\n",
       "      <td>Test1</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    SEASON My Insert    month My Insert2  holiday day_of_week workingday  \\\n",
       "3        1     Test2  一整列被修改了      Test3        0           1          1   \n",
       "4  一整行被修改了   一整行被修改了  一整行被修改了    一整行被修改了  一整行被修改了     一整行被修改了    一整行被修改了   \n",
       "5    哈哈哈哈哈     哈哈哈哈哈  一整列被修改了      哈哈哈哈哈        1       哈哈哈哈哈      哈哈哈哈哈   \n",
       "6        4     Test2  一整列被修改了      Test3        0           4          1   \n",
       "7        3     Test2  一整列被修改了      Test3        1           1          0   \n",
       "\n",
       "   weather     temp    atemp humidity windspeed    count   My Add   season  \n",
       "3        1        8       12  49.0833  0.268033     4322    Test1      NaN  \n",
       "4  一整行被修改了  一整行被修改了  一整行被修改了  一整行被修改了   一整行被修改了  一整行被修改了  一整行被修改了  一整行被修改了  \n",
       "5    哈哈哈哈哈    哈哈哈哈哈    哈哈哈哈哈    哈哈哈哈哈     哈哈哈哈哈    哈哈哈哈哈    哈哈哈哈哈        1  \n",
       "6        1        3        8  55.5652  0.115522     5323    Test1      NaN  \n",
       "7        2       27       28  79.0417  0.212696     3351    Test1      NaN  "
      ]
     },
     "execution_count": 203,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.iloc[5,2] = 19#修改指定一元素，这就相当于一个二维数组了\n",
    "data.iloc[:,2] = \"一整列被修改了\" #修改一整列，也可传入列表，需要保持长度一致\n",
    "data.iloc[1,:] =\"一整行被修改了\"#修改一整行\n",
    "data.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 五、对DataFrame数据中行和列的遍历\n",
    "遍历列数据相对来说比较容易"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "for col in data.columns:\n",
    "    print(data[col])#打印列信息"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对于行数据的遍历我们可以通过Pandas中的方法    \n",
    "**iterrows()**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 204,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "打印一行数据: [1.0, 'Test2', '一整列被修改了', 'Test3', 0.0, 1.0, 1.0, 1.0, 8.0, 12.0, 49.0833, 0.268033, 4322.0, 'Test1', nan]\n",
      "当前行的行索引: 3\n",
      "取出该行中的season列: nan\n"
     ]
    }
   ],
   "source": [
    "for index,row in data.iterrows():\n",
    "    #这里为了使输出结果就显示一行，将其数据类型转换为了list，在迭代器中的数据类型为numpy\n",
    "    print(\"打印一行数据:\",list(row))\n",
    "    print(\"当前行的行索引:\",index)#因为之前我们有删除前3行的数据，所有当前行索引为3\n",
    "    print(\"取出该行中的season列:\",row['season'])\n",
    "    break"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    "对于列数据也有相应的迭代方法，在此不必多说。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 六、数据预处理\n",
    "接下来我们看看读取Pandas之后的一些简单的数据预处理的方法    \n",
    "先重新导入一下数据，还是与开始时一样。\n",
    "\n",
    "先简单汇总一下常用的方法    \n",
    "df.sum()、df.count()、df.mean()#功能即单词翻译    \n",
    "df.describe()#数据统计    \n",
    "df.std()#求标准差    \n",
    "df.skew()#求偏差    \n",
    "df.info()#数据信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 205,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "df1=pd.read_csv(\"Bikeshare_test.csv\")\n",
    "df2=pd.read_csv(\"Bikeshare_train.csv\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 0、数据集描述\n",
    "- season (1 = spring, 2 = summer, 3 = fall, 4 = winter)\n",
    "- month (1 through 12, with 1 denoting Jan)\n",
    "- holiday (1 = the day is a holiday, 0 = otherwise)\n",
    "- day_of_week (0 through 6, with 0 denoting Sunday)\n",
    "- workingday (1 = the day is neither a holiday or weekend, 0 = otherwise)\n",
    "- weather \n",
    "    - 1: Clear, Few clouds, Partly cloudy, Partly cloudy\n",
    "    - 2: Mist + Cloudy, Mist + Broken clouds, Mist + Few clouds, Mist\n",
    "    - 3: Light Snow, Light Rain + Thunderstorm + Scattered clouds, Light Rain + Scattered clouds\n",
    "    - 4: Heavy Rain + Ice Pallets + Thunderstorm + Mist, Snow + Fog \n",
    "- temp (temperature in Celsius)\n",
    "- atemp (apparent temperature, or relative outdoor temperature, in Celsius)\n",
    "- humidity (relative humidity)\n",
    "- windspeed (wind speed)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 1、合并数据\n",
    "- 这里我们将df1与df2的数据合并到一起，可以使用.concat()进行合并    \n",
    "传入的参数为一个待合并的DataFrame的列表    \n",
    "设置合并维度axis,1为横向合并，0为纵向合并"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 206,
   "metadata": {},
   "outputs": [],
   "source": [
    "df=pd.concat([df1,df2],axis=0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 2、缺失值处理\n",
    "- 使用isnull()查看数据的缺失值，再通过sum()统计缺失值的总体个数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 207,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Unnamed: 0     0\n",
       "season         0\n",
       "month          0\n",
       "holiday        0\n",
       "day_of_week    0\n",
       "workingday     0\n",
       "weather        0\n",
       "temp           0\n",
       "atemp          0\n",
       "humidity       0\n",
       "windspeed      0\n",
       "count          0\n",
       "dtype: int64"
      ]
     },
     "execution_count": 207,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.isnull().sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "现在可以看到这个数据是没有缺失值的，假如有缺失值的话，我们就需要对缺失值进行填补    \n",
    "使用df.fillna()进行填充缺失值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 208,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "df.fillna(0)#将缺失值填充为0\n",
    "df.fillna(df.mean())#将缺失值填充为均值\n",
    "print()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 3.数据相关性统计\n",
    "- 可以通过求数据的协方差df.corr()进行数据相关性分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 209,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>season</th>\n",
       "      <th>month</th>\n",
       "      <th>holiday</th>\n",
       "      <th>day_of_week</th>\n",
       "      <th>workingday</th>\n",
       "      <th>weather</th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>humidity</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>season</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.831440</td>\n",
       "      <td>-0.010537</td>\n",
       "      <td>-0.003080</td>\n",
       "      <td>0.012485</td>\n",
       "      <td>0.019211</td>\n",
       "      <td>0.334591</td>\n",
       "      <td>0.341909</td>\n",
       "      <td>0.205445</td>\n",
       "      <td>-0.229046</td>\n",
       "      <td>0.354762</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>month</td>\n",
       "      <td>0.831440</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.019191</td>\n",
       "      <td>0.009509</td>\n",
       "      <td>-0.005901</td>\n",
       "      <td>0.043528</td>\n",
       "      <td>0.220623</td>\n",
       "      <td>0.227510</td>\n",
       "      <td>0.222204</td>\n",
       "      <td>-0.207502</td>\n",
       "      <td>0.270832</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>holiday</td>\n",
       "      <td>-0.010537</td>\n",
       "      <td>0.019191</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.101960</td>\n",
       "      <td>-0.253023</td>\n",
       "      <td>-0.034627</td>\n",
       "      <td>-0.029015</td>\n",
       "      <td>-0.033158</td>\n",
       "      <td>-0.015937</td>\n",
       "      <td>0.006291</td>\n",
       "      <td>-0.004103</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>day_of_week</td>\n",
       "      <td>-0.003080</td>\n",
       "      <td>0.009509</td>\n",
       "      <td>-0.101960</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.035790</td>\n",
       "      <td>0.031087</td>\n",
       "      <td>0.001331</td>\n",
       "      <td>-0.007660</td>\n",
       "      <td>-0.052232</td>\n",
       "      <td>0.014282</td>\n",
       "      <td>0.081384</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>workingday</td>\n",
       "      <td>0.012485</td>\n",
       "      <td>-0.005901</td>\n",
       "      <td>-0.253023</td>\n",
       "      <td>0.035790</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.061200</td>\n",
       "      <td>0.051603</td>\n",
       "      <td>0.051695</td>\n",
       "      <td>0.024327</td>\n",
       "      <td>-0.018796</td>\n",
       "      <td>0.042159</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>weather</td>\n",
       "      <td>0.019211</td>\n",
       "      <td>0.043528</td>\n",
       "      <td>-0.034627</td>\n",
       "      <td>0.031087</td>\n",
       "      <td>0.061200</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.121310</td>\n",
       "      <td>-0.121265</td>\n",
       "      <td>0.591045</td>\n",
       "      <td>0.039511</td>\n",
       "      <td>-0.265738</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>temp</td>\n",
       "      <td>0.334591</td>\n",
       "      <td>0.220623</td>\n",
       "      <td>-0.029015</td>\n",
       "      <td>0.001331</td>\n",
       "      <td>0.051603</td>\n",
       "      <td>-0.121310</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.990640</td>\n",
       "      <td>0.126973</td>\n",
       "      <td>-0.157790</td>\n",
       "      <td>0.516475</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>atemp</td>\n",
       "      <td>0.341909</td>\n",
       "      <td>0.227510</td>\n",
       "      <td>-0.033158</td>\n",
       "      <td>-0.007660</td>\n",
       "      <td>0.051695</td>\n",
       "      <td>-0.121265</td>\n",
       "      <td>0.990640</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>0.140916</td>\n",
       "      <td>-0.184520</td>\n",
       "      <td>0.516624</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>humidity</td>\n",
       "      <td>0.205445</td>\n",
       "      <td>0.222204</td>\n",
       "      <td>-0.015937</td>\n",
       "      <td>-0.052232</td>\n",
       "      <td>0.024327</td>\n",
       "      <td>0.591045</td>\n",
       "      <td>0.126973</td>\n",
       "      <td>0.140916</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.248489</td>\n",
       "      <td>-0.085879</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>windspeed</td>\n",
       "      <td>-0.229046</td>\n",
       "      <td>-0.207502</td>\n",
       "      <td>0.006291</td>\n",
       "      <td>0.014282</td>\n",
       "      <td>-0.018796</td>\n",
       "      <td>0.039511</td>\n",
       "      <td>-0.157790</td>\n",
       "      <td>-0.184520</td>\n",
       "      <td>-0.248489</td>\n",
       "      <td>1.000000</td>\n",
       "      <td>-0.195128</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>count</td>\n",
       "      <td>0.354762</td>\n",
       "      <td>0.270832</td>\n",
       "      <td>-0.004103</td>\n",
       "      <td>0.081384</td>\n",
       "      <td>0.042159</td>\n",
       "      <td>-0.265738</td>\n",
       "      <td>0.516475</td>\n",
       "      <td>0.516624</td>\n",
       "      <td>-0.085879</td>\n",
       "      <td>-0.195128</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "               season     month   holiday  day_of_week  workingday   weather  \\\n",
       "season       1.000000  0.831440 -0.010537    -0.003080    0.012485  0.019211   \n",
       "month        0.831440  1.000000  0.019191     0.009509   -0.005901  0.043528   \n",
       "holiday     -0.010537  0.019191  1.000000    -0.101960   -0.253023 -0.034627   \n",
       "day_of_week -0.003080  0.009509 -0.101960     1.000000    0.035790  0.031087   \n",
       "workingday   0.012485 -0.005901 -0.253023     0.035790    1.000000  0.061200   \n",
       "weather      0.019211  0.043528 -0.034627     0.031087    0.061200  1.000000   \n",
       "temp         0.334591  0.220623 -0.029015     0.001331    0.051603 -0.121310   \n",
       "atemp        0.341909  0.227510 -0.033158    -0.007660    0.051695 -0.121265   \n",
       "humidity     0.205445  0.222204 -0.015937    -0.052232    0.024327  0.591045   \n",
       "windspeed   -0.229046 -0.207502  0.006291     0.014282   -0.018796  0.039511   \n",
       "count        0.354762  0.270832 -0.004103     0.081384    0.042159 -0.265738   \n",
       "\n",
       "                 temp     atemp  humidity  windspeed     count  \n",
       "season       0.334591  0.341909  0.205445  -0.229046  0.354762  \n",
       "month        0.220623  0.227510  0.222204  -0.207502  0.270832  \n",
       "holiday     -0.029015 -0.033158 -0.015937   0.006291 -0.004103  \n",
       "day_of_week  0.001331 -0.007660 -0.052232   0.014282  0.081384  \n",
       "workingday   0.051603  0.051695  0.024327  -0.018796  0.042159  \n",
       "weather     -0.121310 -0.121265  0.591045   0.039511 -0.265738  \n",
       "temp         1.000000  0.990640  0.126973  -0.157790  0.516475  \n",
       "atemp        0.990640  1.000000  0.140916  -0.184520  0.516624  \n",
       "humidity     0.126973  0.140916  1.000000  -0.248489 -0.085879  \n",
       "windspeed   -0.157790 -0.184520 -0.248489   1.000000 -0.195128  \n",
       "count        0.516475  0.516624 -0.085879  -0.195128  1.000000  "
      ]
     },
     "execution_count": 209,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.drop(df.columns[0],axis=1,inplace=True)#先删除没有用的第1列值\n",
    "df.corr()#现在可以看到每个数据的相关性，越接近于1相关项越高。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "求得协方差之后，可以通过绘制热力图来可视化变量与变量之间的相关性。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 4.使用Pandas进行简单的可视化\n",
    "- 对于任意的DataFrame数据类型，我们可以通过.plot()直接将它可视化出来\n",
    "默认是绘制折线图，当然，我们可以通过设置kind参数来更改图表类型。\n",
    "plot()中还有许多参数可以修改，根据自己的需要具体添加。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 210,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x2784fdaa0b8>"
      ]
     },
     "execution_count": 210,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEICAYAAABBBrPDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xl8VNXZwPHfM1nJRiAJ2SHshEXCIkpVREULagF3rbbVVq2+ta3V1rW11r7a1lbt29a2WtvaulMXwKXuCwHZIYQlAwl7QgIJEDJJyH7eP+YOjBjCkpnM3Jnn+/nkkzt3bu45czMzzz3n3PscMcaglFJKHY0j0BVQSikV3DRQKKWU6pIGCqWUUl3SQKGUUqpLGiiUUkp1SQOFUkqpLmmgUMrPRCRWRIyI5AS6LkqdDA0UKqSISL3XT4eIHPR6fG039rtERK7r4vkRVjDwlLVFRO48iXJuEZEPT7aeSvlDZKAroJQvGWMSPMsisg240RjTU1+87Z7yRWQK8IGIrASW9FD5SvmFtihUWBGRCBH5mXXGXyMiL4hIsvVcvIi8LCL7RKRWRJaKSB8ReQw4FXjGai08dqxyjDELgE3A6E7q0FdEXhSRahHZKiJ3ids44PfAVKucKt++eqVOjgYKFW5+AlwAnAnkAK3AE9ZzN+JuZWcDqcBtQIsx5k5gOe7WSYL1+KisL/2pwDCgqJNN/gpEAQOB84Fbga8bY1YDtwOfWuVkdO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Z5tRGQY0B97Zpg9AOy3WlsA3wA+62L7pcBUq889CrjC67neQIW1/K0j/u4Z3GdTczr5UvalBcCPrd+FwC24z1qWAGdb/c0RwDV0/TofAPYCfz6Bsp3AIBHJsx5fdUS9PO+XGbi76cB9zPYbYxqtlsPpnj8wxizF/V77Ol9snfQEF+7PA8B7wLdFJAFARLJFpN8J7m+WuMf1UnB3Pyz3WU39YxvuE0xwdyGdLCcwUEQGW4+vOcp23scbqzfiPeAvBPYkwdtHwJXW/xBrPOZz4Grr+WuBhdbyNg4fv1m4u4CP5QvH4Gj81fU0BlhmdTPdj/sL4HLgN1ZzvwjwXM3yM9xfhB/g/gd7/FasQVDcH/g1uL9AIqxulleA640x3pHSTr6F+zUWAwW4xyk6ZYypxN3nvBh3H/4qr6cfBP4jIoV8Oc3yfCAB/7/pC3GPoyw2xuwGmoBCq9734u72WAOsMsbMO8a+bgdi5TgvSDDGHMR9pdC71sDlbtyBGNwt1CnWIOUFHG7hvAtEWsf+l7gDmrc5wCJjzH56kHUGu8h6z5+Pu3thsfV+f5Xj+EAfYRnwNu7X90tjzC5f1tcPfgfcKu5Lok/6wgvrC/9m4G3rPbH9KJu+DPzEGhT3BJUXcJ+hv3+y5fuSMWY98DDwmfXd+TjwA9xdZMW4TzJ/aG3+N9wnZstwn5w3HEcRTwP/PdZgtqbwCGHWFSRPGGPOOubGNiYiCcaYequ5/SRQaox54lh/18X+3sJ93D7yWSV7mIg8iHsw83eBroudiMiPgd7GmJ8Fui7BJJj68ZUPifumolvx6s4LYTeJyLdw98muBp46mZ2ISDLus/A1dg4S6uSIyBu4x9bODXRdgo22KJRSSnVJ78xWSinVJQ0USimluqSBQimlVJc0UCillOqSBgqllFJd+n+3n/Ff6BEU2wAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "df.corr()['count'].plot(title=\"Test Plot\",kind='line')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 5.处理离散型数据或者非数值型数据"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 我们可以看到数据的前六列均为离散变量，为了使得这些离散变量能够更好地转换为对我们有用的特征，    \n",
    "我们需要对这些数据进行独热（One Hot）编码\n",
    "Pandas可以通过df.get_dummies()进行转换，    \n",
    "但是在转换之前，需要将对应列的数据类型转换为\"category\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 213,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>humidity</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>count</th>\n",
       "      <th>season_1.0</th>\n",
       "      <th>season_2.0</th>\n",
       "      <th>season_3.0</th>\n",
       "      <th>season_4.0</th>\n",
       "      <th>month_1.0</th>\n",
       "      <th>...</th>\n",
       "      <th>day_of_week_2.0</th>\n",
       "      <th>day_of_week_3.0</th>\n",
       "      <th>day_of_week_4.0</th>\n",
       "      <th>day_of_week_5.0</th>\n",
       "      <th>day_of_week_6.0</th>\n",
       "      <th>workingday_0.0</th>\n",
       "      <th>workingday_1.0</th>\n",
       "      <th>weather_1.0</th>\n",
       "      <th>weather_2.0</th>\n",
       "      <th>weather_3.0</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>56.2083</td>\n",
       "      <td>0.194037</td>\n",
       "      <td>3830.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>65.2917</td>\n",
       "      <td>0.350133</td>\n",
       "      <td>2114.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>36.0</td>\n",
       "      <td>37.0</td>\n",
       "      <td>56.8333</td>\n",
       "      <td>0.149883</td>\n",
       "      <td>915.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>8.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>49.0833</td>\n",
       "      <td>0.268033</td>\n",
       "      <td>4322.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>28.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>69.7083</td>\n",
       "      <td>0.215171</td>\n",
       "      <td>6591.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 35 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   temp  atemp  humidity  windspeed   count  season_1.0  season_2.0  \\\n",
       "0   2.0    6.0   56.2083   0.194037  3830.0           1           0   \n",
       "1   1.0    3.0   65.2917   0.350133  2114.0           1           0   \n",
       "2  36.0   37.0   56.8333   0.149883   915.0           0           1   \n",
       "3   8.0   12.0   49.0833   0.268033  4322.0           1           0   \n",
       "4  28.0   29.0   69.7083   0.215171  6591.0           0           1   \n",
       "\n",
       "   season_3.0  season_4.0  month_1.0  ...  day_of_week_2.0  day_of_week_3.0  \\\n",
       "0           0           0          0  ...                0                0   \n",
       "1           0           0          0  ...                0                0   \n",
       "2           0           0          0  ...                0                0   \n",
       "3           0           0          0  ...                0                0   \n",
       "4           0           0          0  ...                0                0   \n",
       "\n",
       "   day_of_week_4.0  day_of_week_5.0  day_of_week_6.0  workingday_0.0  \\\n",
       "0                1                0                0               0   \n",
       "1                1                0                0               0   \n",
       "2                1                0                0               0   \n",
       "3                0                0                0               0   \n",
       "4                0                0                0               1   \n",
       "\n",
       "   workingday_1.0  weather_1.0  weather_2.0  weather_3.0  \n",
       "0               1            1            0            0  \n",
       "1               1            0            1            0  \n",
       "2               1            0            1            0  \n",
       "3               1            1            0            0  \n",
       "4               0            1            0            0  \n",
       "\n",
       "[5 rows x 35 columns]"
      ]
     },
     "execution_count": 213,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "columns=df.columns.tolist()[0:6]#取离散变量\n",
    "for col in columns:\n",
    "    df[col]=df[col].astype('category')#转换为可以进行独热编码的数据类型\n",
    "one_hot=pd.get_dummies(df)#转换为独热编码\n",
    "one_hot.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 6.删除One Hot编码之后的冗余项"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 可以看到经过One Hot编码之后将每一个离散值都转换成了特征列。\n",
    "但对于该编码方式而言，以season为例，season有四列，我们只需要知道前三列就足够了，    \n",
    "因为如果该特征不属于这三种特征，则必然属于第四种特征，所以对于每种特征得到的结果，我们需要删除一列多余的列。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 215,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>humidity</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>count</th>\n",
       "      <th>season_1.0</th>\n",
       "      <th>season_2.0</th>\n",
       "      <th>month_1.0</th>\n",
       "      <th>month_2.0</th>\n",
       "      <th>month_3.0</th>\n",
       "      <th>...</th>\n",
       "      <th>month_7.0</th>\n",
       "      <th>month_8.0</th>\n",
       "      <th>month_9.0</th>\n",
       "      <th>month_10.0</th>\n",
       "      <th>day_of_week_0.0</th>\n",
       "      <th>day_of_week_1.0</th>\n",
       "      <th>day_of_week_2.0</th>\n",
       "      <th>day_of_week_3.0</th>\n",
       "      <th>day_of_week_4.0</th>\n",
       "      <th>weather_1.0</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>6.0</td>\n",
       "      <td>56.2083</td>\n",
       "      <td>0.194037</td>\n",
       "      <td>3830.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>65.2917</td>\n",
       "      <td>0.350133</td>\n",
       "      <td>2114.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>36.0</td>\n",
       "      <td>37.0</td>\n",
       "      <td>56.8333</td>\n",
       "      <td>0.149883</td>\n",
       "      <td>915.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>8.0</td>\n",
       "      <td>12.0</td>\n",
       "      <td>49.0833</td>\n",
       "      <td>0.268033</td>\n",
       "      <td>4322.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>28.0</td>\n",
       "      <td>29.0</td>\n",
       "      <td>69.7083</td>\n",
       "      <td>0.215171</td>\n",
       "      <td>6591.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 23 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   temp  atemp  humidity  windspeed   count  season_1.0  season_2.0  \\\n",
       "0   2.0    6.0   56.2083   0.194037  3830.0           1           0   \n",
       "1   1.0    3.0   65.2917   0.350133  2114.0           1           0   \n",
       "2  36.0   37.0   56.8333   0.149883   915.0           0           1   \n",
       "3   8.0   12.0   49.0833   0.268033  4322.0           1           0   \n",
       "4  28.0   29.0   69.7083   0.215171  6591.0           0           1   \n",
       "\n",
       "   month_1.0  month_2.0  month_3.0  ...  month_7.0  month_8.0  month_9.0  \\\n",
       "0          0          1          0  ...          0          0          0   \n",
       "1          0          0          0  ...          0          0          0   \n",
       "2          0          0          0  ...          0          0          0   \n",
       "3          0          1          0  ...          0          0          0   \n",
       "4          0          0          0  ...          0          0          0   \n",
       "\n",
       "   month_10.0  day_of_week_0.0  day_of_week_1.0  day_of_week_2.0  \\\n",
       "0           0                0                0                0   \n",
       "1           0                0                0                0   \n",
       "2           0                0                0                0   \n",
       "3           0                0                1                0   \n",
       "4           0                1                0                0   \n",
       "\n",
       "   day_of_week_3.0  day_of_week_4.0  weather_1.0  \n",
       "0                0                1            1  \n",
       "1                0                1            0  \n",
       "2                0                1            0  \n",
       "3                0                0            1  \n",
       "4                0                0            1  \n",
       "\n",
       "[5 rows x 23 columns]"
      ]
     },
     "execution_count": 215,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "delete={}\n",
    "for col in one_hot.columns:\n",
    "    if len(col.split('_'))>1:#用'_'分割字符串，长度超过1的就是经过编码的变量\n",
    "        delete[col.split('_')[0]]=col#存入字典，key为原列名，值为独热编码的最后一列\n",
    "one_hot.drop(list(delete.values()),axis=1,inplace=True)\n",
    "one_hot.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "相关的总结到此为止，具体的源码以及数据集已经上传到了Github https://github.com/Yourdaylight/DataAnalysis.git 。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
